package com.ardo.execption.code;

public enum BaseCodeEnum implements ErrorCode {
    FAILURE(1, "Failure"),

    /* ------------ TOKEN校验数据，以 00 开头---------------*/
    ERR_MSG_USERNAME_EMPTY(00001, "用户名不能为空"),
    ERR_MSG_TOKEN_ERR(00002, "token校验失败"),
    ERR_MSG_TOKEN_EXP(00003, "token已过期"),
    ERR_MSG_TOKEN_EMPTY(00004, "token不能为空"),


    /* ------------ 登录数据，以 10 开头---------------*/
    LOGIN_ERROR_NO_REGISTER(10000, "需要授权注册后才能登陆"),
    LOGIN_SUCCESS(10001, "登录成功"),
    LOGIN_ERROR(10002, "登录失败"),
    LOGIN_ERROR_QUERY_USER_AUTH_FAIL(10003, "获取用户权限信息失败，请联系管理员"),
    LOGIN_ERROR_QUERY_USER_INFO_FAIL(10004, "用户信息未录入，请联系管理员"),



    /* ------------ 基础数据错误，以 11 开头---------------*/


    /* ------------ 数据错误，以 12 开头---------------*/


    /* ------------ 数据错误，以 13 开头---------------*/



    BAD_REQUEST(400, "Bad Request"),

    UNAUTHORIZED(401, "Unauthorized"),

    FORBIDDEN(403, "Forbidden"),

    NOT_FOUND(404, "Not Found"),

    METHOD_NOT_ALLOWED(405, "Method Not Allowed"),

    INTERNAL_SERVER_ERROR(500, "Internal Server Error"),

    INTERNAL_SERVER_ERROR_UPDATE(501, "更新失败"),

    METHOD_ARGUMENT_NOT_VALID_EXCEPTION(401001, "方法参数校验异常"),
    ;

    private final int code;
    private final String message;

    BaseCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
